REM Create tags file

cd /d %1

REM ctags --languages=asm,make,c --langmap=asm:.asm.equ.inc.cfg.mak.mac.sdl.def -R %1
REM ctags --languages=asm,make,c --langmap=asm:.asm.equ.inc.cfg.mak.mac.sdl.def.aid -R %1
ctags --languages=asm,make,c --langmap=asm:.asm.equ.inc.cfg.mak.mac.sdl.def.aid,c:.c.h -R %1

REM OA_Hsiao Build for Ctag Purpose

SET OLD=.\
SET TEMP_NEW=REPLACETEMPSTRING
SET NEW=%CD:\=\\\%\\\

REM Rename tags' filename
move tags temp_tags.txt

REM Search and replace '.\' with 'REPLACETEMPSTRING'
gsar -s%OLD% -r%TEMP_NEW% -o temp_tags.txt

REM Search and replace 'REPLACETEMPSTRING' with the absolute path.
sed "s/%TEMP_NEW%/%NEW%/g" temp_tags.txt > tags

del temp_tags.txt
rem pause

rem OA_Hsiao Build for absolute path Ctag Purpose 2009/01/09